// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch;

public sealed partial class TextEmbedding
{
	[JsonInclude, JsonPropertyName("model_id")]
	public string ModelId { get; set; }
	[JsonInclude, JsonPropertyName("model_text")]
	public string ModelText { get; set; }

	public static implicit operator Elastic.Clients.Elasticsearch.QueryVectorBuilder(TextEmbedding textEmbedding) => Elastic.Clients.Elasticsearch.QueryVectorBuilder.TextEmbedding(textEmbedding);
}

public sealed partial class TextEmbeddingDescriptor : SerializableDescriptor<TextEmbeddingDescriptor>
{
	internal TextEmbeddingDescriptor(Action<TextEmbeddingDescriptor> configure) => configure.Invoke(this);

	public TextEmbeddingDescriptor() : base()
	{
	}

	private string ModelIdValue { get; set; }
	private string ModelTextValue { get; set; }

	public TextEmbeddingDescriptor ModelId(string modelId)
	{
		ModelIdValue = modelId;
		return Self;
	}

	public TextEmbeddingDescriptor ModelText(string modelText)
	{
		ModelTextValue = modelText;
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
		writer.WriteStartObject();
		writer.WritePropertyName("model_id");
		writer.WriteStringValue(ModelIdValue);
		writer.WritePropertyName("model_text");
		writer.WriteStringValue(ModelTextValue);
		writer.WriteEndObject();
	}
}